var a = ["a", "b", "c"];
a.forEach(function(entry) 
{
    print(entry=='e');
});

var elements = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var fns = [];

for(var i = 0; i < elements.length; i++) {
  (function() {
    var el = elements[i];
    fns.push(function() {
        print(el);
      });
  }());
}

fns[2]();

print("2..............");
var elements = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var fns = [];

for(var i = 0; i < elements.length; i++) {
  var el = elements[i];
  fns.push(function() {
     print(el);
    });
}
fns[2]();